var MainForm = null;
// Inicializar
Event.observe(window, 'load', function() {   
	MainForm = $('frmLogin');  

	showDialog();
	
	$('user').focus();
	
	Key.Enter('user', doLogin);
	Key.Enter('pwd', doLogin);
	
});

function doLogin (){
	MainForm.submit();
}

function showDialog(){
	if($('msg')){
		var message = $('msg').value;
		var closeLabel = Messages.closeButton;
		
		if(Messages[message]){
			IMessage.alert(Messages[message]);
		}
	}
}